﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.MainModule.Entities;
using Domain.MainModule.Common;

namespace Application.MainModule.CommonManagement
{
    public class CommonManagementService: ICommonManagementService
    {

        IGenderRepository _IGenderRepository;
        IMaritalStatusRepository _IMaritalStatusRepository;

        public CommonManagementService(IGenderRepository genderRepository, IMaritalStatusRepository maritalStatusRepository)
        {
            if (genderRepository == (IGenderRepository)null)
                throw new ArgumentNullException("genderRepository");

            if (maritalStatusRepository == (IMaritalStatusRepository)null)
                throw new ArgumentNullException("maritalStatusRepository");

            this._IGenderRepository = genderRepository;
            this._IMaritalStatusRepository = maritalStatusRepository;
        }

        public List<Gender> GetGenders()
        {
            return _IGenderRepository.GetAll().ToList<Gender>();
        }

        public List<MaritalStatus> GetMaritalStatus()
        {
            return _IMaritalStatusRepository.GetAll().ToList<MaritalStatus>();
        }
    }
}
